package com.pvdnc.riru.common;

import android.app.Application;

import java.util.ArrayList;
import java.util.List;

public class ApplicationObserverManager {
    public static final ApplicationObserverManager INSTANCE=new ApplicationObserverManager();

    private final List<ApplicationObserver> mGlobalObserverList=new ArrayList<>();

    public void addObserver(ApplicationObserver observer){
        mGlobalObserverList.add(observer);
    }

    public void callObserver(Application app){
        for (ApplicationObserver observer:mGlobalObserverList){
            observer.beforeApplicationOnCreate(app);
        }
    }
}
